package cn.imvc.app.models;

import java.io.IOException;
import java.util.Collection;
import java.util.Date;
import java.util.LinkedHashMap;
import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.security.access.ConfigAttribute;
import org.springframework.security.web.util.matcher.RequestMatcher;

import cn.imvc.app.entities.Orders;
import cn.imvc.app.entities.StorageOrder;
import cn.imvc.data.domain.ViewRequest;
import jxl.read.biff.BiffException;

public interface StorageOrderModel {
	LinkedHashMap<RequestMatcher, Collection<ConfigAttribute>> getRequestMap();
	
	Page<StorageOrder> find(ViewRequest viewRequest);
	
	StorageOrder get(int id);

	StorageOrder save(StorageOrder storageOrder);
	
	StorageOrder update(StorageOrder storageOrder);

	void delete(int id);

	void deleteBatch(int[] ids);
	
	boolean updateExportOrder(int id);
	
	boolean updateDelivered(StorageOrder storageOrder) throws Exception;
	
	boolean updateSyncState(Orders orders);
	
	boolean updateSyncStateByPreState(Orders orders,Byte state);

	List<StorageOrder> findByState(Byte value);
	
	/**
	 * 仓库订单，自动收货之后，需要更改三级goodsOrder的状态和收货时间
	 * @param storageOrder
	 */
	void updateAutoReceipt(StorageOrder storageOrder);
	/**
	 * 批量导出仓库订单
	 * @param viewRequest
	 * @return
	 */
	boolean updateBatchExcelExport(ViewRequest viewRequest);
	
	void updateBiLogisticsNo(String storageOrderCode,String logisticsNo);

	List<StorageOrder> findByStateAndReceiptEndTimeLessThan(Byte value, Date date);
	
	void updateSaveAndSync(StorageOrder storageOrder);
	
	List<StorageOrder> findByCode(String orderCode);
}
